﻿using Interface.Core.Controllers;
using Interface.Core.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Interface.Mvc.Areas.EngOA.Controllers
{
    public class SyUserController : CoreController
    {
        [HttpGet]
        public string GetByMobile(string mobile)
        {
            string sql = "select id, name from sy_user where mobile = @mobile";

            var list = db.EngOA.Query<dynamic>(sql, new { mobile });

            if (list.Count() > 0)
            {
                return ResultUtility.SuccessResult(data: list.FirstOrDefault());
            }

            return ResultUtility.FailureResult();
        }
    }
}
